refactor(generator): include commit spaces in generated words (@miodec, @Leonabcd123)#8157
Open
Miodec wants to merge 91 commits into
Open
refactor(generator): include commit spaces in generated words (@miodec, @Leonabcd123)#8157Miodec wants to merge 91 commits into
Miodec wants to merge 91 commits into
Conversation
Miodec
commented
Jun 24, 2026
Words now carry their commit separator as a trailing space emitted by the generator (getNextWord) instead of being added retroactively to the previous word in Words.push. The old retroactive model assumed the next word was always generated before the current one was committed, which is false for plus_zero (toPush:1, zero lookahead): the current word was read bare during live validation, breaking commit, stop-on-error, expert, and quick-end. - strip prev words inside getNextWord so trailing separators don't leak into dedup/punctuation/capitalization feedback - guard the separator append for nospace mode and newline-terminated words - strip the trailing separator from the final word once generation is complete, covering the bulk, section, and lazy addWord paths (final word stays bare) - restore the expert-mode guard so a leading separator (empty input) never fails - move areAllTestWordsGenerated -> areAllWordsGenerated in words-generator Update test-words/validation/fail-or-finish specs to the new contracts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment on lines
+67
to
+72
| const goingToNextWord = shouldGoToNextWord({ | ||
| data, | ||
| inputValue, | ||
| targetWord: currentWordTextWithCommit, | ||
| commitCharacterType, | ||
| }); |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
frontend/src/ts/utils/strings.ts:391
isSpacedocstring says “directly typable … on a standard keyboard”, but the implementation includes IME/Unicode-only spaces (e.g. U+3000, U+200B). This mismatch can mislead callers about what the predicate actually means.
/**
* Checks if a character is a directly typable space character on a standard keyboard.
* These are space characters that can be typed without special input methods or copy-pasting.
* @param char The character to check.
* @returns True if the character is a directly typable space, false otherwise.
*/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the generation to include commit/separation character in the target word.